package com.mrxu.monitor.config;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 拦击起忽略的信息配置
 */
@Data
public class InterceptorConfig {

    /**
     * 拦击的路径
     * 默认拦击/**
     */
    private List<String> path;

    /**
     * 忽略的路径
     */
    private List<String> excludePath;

    /**
     * 忽略的ip
     */
    private List<String> excludeIp;

    /**
     * 默认的配置
     * @return 默认拦击配置
     */
    public static InterceptorConfig getDefault(){
        InterceptorConfig defaultInterceptorConfig = new InterceptorConfig();
        List<String> path = new ArrayList<>();
        path.add("/**");
        defaultInterceptorConfig.setPath(path);
        List<String> excludePath = new ArrayList<>();
        excludePath.add("/**/*.css");
        excludePath.add("/**/*.js");
        excludePath.add("/**/*.html");
        excludePath.add("/**/*.ico");
        defaultInterceptorConfig.setExcludePath(excludePath);
        return defaultInterceptorConfig;
    }
}
